#include "bsp_init.h"
#include "tim.h"
#include "usart.h"
#include "fsmc.h"
#include "bsp_led.h"
#include "bsp_sdcard.h"
void bsp_system_init(void)
{
    HAL_StatusTypeDef hal_Status = HAL_ERROR;
    hal_Status = HAL_TIM_Base_Start_IT(&htim6);  
    hal_Status = HAL_UART_Receive_DMA(&huart1, g_au8Uart1RxBuf, RX_BUFFER_SIZE_2);              
    hal_Status = HAL_UART_Receive_DMA(&huart2, g_pau8Uart2RxBuf, RX_BUFFER_SIZE_1); 
    if(HAL_OK != hal_Status)
    {
        bsp_led_on(2);
        printf("[ERROR] system init failed, hal_status = %d\n", hal_Status);
    }
}


void all_bsp_init(void)
{
    //system;
    bsp_system_init();
    //lcd;
    bsp_lcd_init();
    //flash;
    bsp_flash_init();
    //eeprom;
    //esp;
    bsp_esp_init();
    //jdy;
    //bsp_jdy_init();
    //sdcard;
    bsp_sdcard_init();
}
